package com.sdsy.blockchaintrainingback.utils;

import java.security.SecureRandom;

public class RandomStringGenerator {
    private static final String CHAR_SET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    private static final SecureRandom random = new SecureRandom();

    public static String getRandomString(int length) {
        StringBuilder result = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            result.append(CHAR_SET.charAt(random.nextInt(CHAR_SET.length())));
        }
        return result.toString();
    }
}
